#ifndef CONDITION_H
#define CONDITION_H

#include <QString>
#include <QVector>
#include "entity.h"

struct ConditionResult
{
    QString name;
    double result;
    QVector<EntityResult> entityResults;
};

class Condition
{
public:
    Condition();
    ~Condition();
    ConditionResult Run(int nRuleID, QString entityName, bool isEnd);
    double GetResult();
    void SetName(QString name){m_sConditionName = name;}
    QString GetName(){return m_sConditionName;};
    void SetType(QString type){m_sType = type;};
    QString GetType(){return m_sType;};
    void SetFormula(QString formula){m_sFormula = formula;};
    QString GetFormula(){return m_sFormula;};
    void AddEntity(Entity* entity);
    void SetArgName(QString argName){m_sArgName = argName;};
    QString GetArgName(){return m_sArgName;};
private:
    QString m_sState;
    QString m_sConditionName;
    double m_dResult;
    QString m_sType;
    QString m_sFormula;
    QVector<Entity*> m_vEntitys;
    QString m_sArgName;
};

#endif // CONDITION_H
